import axios  from "axios";
// 后端java接口地址前缀
axios.defaults.baseURL = 'http://localhost:8080';
/**
 * axios封装，发送get请求
 * get请求
 * @param url '/api/user'
 * @param params {
 *  ID:12345
 * }
 */
export function doGet(url,params){
    return  axios.get(url,{
        params:params
    })


}

/**
 * POST请求
 * @param url '/api/user'
 * @param data {
 *   firstName:'Fred',
 *   lastName:'Flintstone'
 * }
 */
export function doPost(url,data){
    return  axios.post(url,data)

}